﻿package {
	import flash.display.*;
	import flash.events.MouseEvent;
	import flash.geom.ColorTransform;
	import flash.filters.*;
	class llkIcon extends MovieClip {
		private var _iconid:uint;
		private var _iconFrame:uint;
		private var theIcon:TwoIcons;
		public function llkIcon(iconid:uint, n:uint, llkWidth:Number, llkx:Number, llky:Number, llkpress:Function=null):void {
			_iconid=iconid;
			theIcon=new TwoIcons();
			addChild(theIcon);
			var filter1:DropShadowFilter = new DropShadowFilter();
			filter1.quality=BitmapFilterQuality.HIGH;
			theIcon.filters=[filter1];

			theIcon.gotoAndStop(n+1);
			width=llkWidth;
			height=llkWidth;
			x=llkx;
			y=llky;
			enabled=true;
			//this.buttonMode=true;
			this.addEventListener(MouseEvent.CLICK, llkpress,true);
			//this.addEventListener(MouseEvent.ROLL_OVER, onover,true);
		}
		private function onover(e:MouseEvent):void {
			//trace("iconinfo",iconFrame,iconid);
		}
		public function resetllkIcon(iconid:uint, n:int, llkWidth:Number, llkx:Number, llky:Number):void {
			_iconid=iconid;
			width=llkWidth;
			height=llkWidth;
			x=llkx;
			y=llky;
			alpha=1;
			if (n==-1) {
				enabled=false;
				visible=false;
				return;
			}
			theIcon.gotoAndStop(n+1);
			visible=true;
			enabled=true;
			transform.colorTransform=new ColorTransform();
		}
		public function get iconid():uint {
			return _iconid;
		}
		public function get iconFrame():uint {
			return theIcon.currentFrame-1;
		}
		public function set iconFrame(n:uint):void {
			theIcon.gotoAndStop(n+1);
		}
	}
}